//
//  UserViewController.m
//  hw3
//
//  Created by itlab on 2020/12/4.
//  Copyright © 2020 itlab. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserViewController.h"

@interface UserViewController ()

@end

@implementation UserViewController

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        self.navigationItem.title = @"Login";
        
        
        
        
        
        self.con1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
        
        self.input1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 310, 70, 40)];
        self.input1.numberOfLines = 1;
        self.input1.textColor = [UIColor blackColor];
        self.input1.text = @"用户名";
        [self.con1 addSubview:self.input1];
        UITextField *textField1= [[UITextField alloc]initWithFrame:CGRectMake(90, 310, 280, 40)];
        
        textField1.borderStyle = UITextBorderStyleRoundedRect;
        textField1.placeholder = @"请输入用户名";
        textField1.clearButtonMode = UITextFieldViewModeAlways;
        [self.con1 addSubview:textField1];
        self.textFieldA = textField1;
        
        // 密码输入
        self.input2 = [[UILabel alloc] initWithFrame:CGRectMake(20, 450, 70, 40)];
        self.input2.numberOfLines = 1;
        self.input2.textColor = [UIColor blackColor];
        self.input2.text = @"密  码";
        [self.con1 addSubview:self.input2];
        UITextField *textField2 = [[UITextField alloc]initWithFrame:CGRectMake(90, 450, 280, 40)];
       
        textField2.borderStyle = UITextBorderStyleRoundedRect;
        //textField2.keyboardType = UIKeyboardTypeASCIICapable;
        textField2.placeholder = @"请输入密码";
        textField2.clearButtonMode = UITextFieldViewModeAlways;
        textField2.secureTextEntry = YES;
        [self.con1 addSubview:textField2];
        self.textFieldB = textField2;
        
        
        [self.view addSubview:self.con1];
    }
    return self;
}

- (void)viewDidLoad{
    //self.navigationController.tabBarItem = [[UITabBarItem alloc]init];
    [self.navigationController.tabBarItem setTitle:@"hello"];
}

-(void)loadExtraElements{
    self.navigationController.tabBarItem.title = @"User";
    UIImage* img = [UIImage imageNamed:@"tupian-2.png"];
    img = [img imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.navigationController.tabBarItem.image = img;
}

@end
